<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--<script src="../js/angular1.6.3.min.js"></script>-->
    <title>Title</title>
    <style>
        /*html,body{font-size: 62.5%}*/
        h1{font-size: 1.6rem}
        /*p{font-size: 1.4rem;}*/
        img{width: 5rem;height: 5rem;background-color: #ccc;}
        pre{width:20rem ;height: 80rem;}
    </style>
    <script></script>
    <!--<script>
        /*window.onload= function () {
            alert(1)
            /!*var oP=document.getElementById('p');
            oP.oncopy= function () {
                alert(1)
            }*!/
            /!*var oTxt=document.getElementById('txt');
            oTxt.oninput= function () {
                console.log(1)
            }*!/

            /!*function fn(ev){
                var x = ev.which || ev.keyCode;  // 使用 which 或 keyCode, 这样可支持不同浏览器
                return x;
            }
            document.onkeydown= function () {
                alert(fn())
            };*!/
            //str.indexOf("")
            /!*(function(win,doc){
                win.addEventListener('resize',change,false);
                function change(){
                    doc.documentElement.style.fontSize=doc.documentElement.clientWidth/320+'%';
             }
                change();
            })(window,document)*!/

        }*/

            /*document.addEventListener('resize',change,false);

            function change(){
                var oMyDiv=document.getElementById('myDiv');
                alert(oMyDiv)
                var oMyP=document.getElementById('myp');
                oMyDiv.addEventListener('click', function () {
                    alert("DIV")
                });
            };
            change()*/

    </script>-->
</head>
<body>
<div style="background-color: red;" id="myDiv">2
    <p id="myP" style="background-color: green;width: 100px;">1</p>
</div>
<input type="text"  id="txt" />
<div id="div">123</div>
<h1><a href="#">我是个表头</a></h1>
<p id="p" style="text-indent: 2em">拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了拿上单反加拉丝的肌肤拉锯式的风口浪尖撒到了；放</p>
<div>
    <img src="" alt="">
    <img src="" alt="">
    <img src="" alt="">
    <img src="" alt="">
    <img src="" alt="">
    <img src="" alt="">


    <pre>
       <xmp><a href="#">sdfsdfdsfsd</a></xmp>
    </pre>
</div>
<div ng-app="myApp" ng-controller="chengle">
    {{names.name}}
</div>
</body>
</html>
<script>
 /*   var app= angular.module('myApp',[]);
    app.controller('chengle',function($scope,$http){
        $http.post("../text/2.php",123).then(function(response){
            //console.log(response);
            $scope.names=eval(response.data);
        }, function (err) {
            alert("错误")
        })
    })*/
          /*  window.onload= function () {
                var oMyDiv=document.getElementById('myDiv');
                var oMyP=document.getElementById('myP');
                oMyDiv.addEventListener('click', function(){
                    alert("DIV");
                },false);
                oMyP.addEventListener('click', function () {
                    alert("P")

                },false)

            }*/
 window.addEventListener("load ",function(){
     window.addEventListener('scroll', function () {
         var oTop=document.getElementById('top');
         var oH=document.documentElement.clientHeight;
         var oS=document.body.scrollTop;
         if(oH+oS>oH){
             oTop.style.display="block";

         }else {
             oTop.style.display="none";
         }
         oTop.onclick= function () {
             var timer=null;
             clearInterval(timer);
             timer=setInterval(function () {
                 console.log(oS)
                 document.body.scrollTop=(oS*=0.8);
                 if (oS<=1){
                     oS=0;
                     clearInterval(timer);
                     oTop.style.display="none";
                     //alert(oS)
                 }
                 console.log(oS)
             },30)
         }
     },false);
     var oM=document.getElementById("myDiv");
     alert(oM)
 })
</script>
